home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / modeler / center.lwm < prev    next >
Text File  |  1993-06-08  |  752b  |  31 lines

  1. /* CMD: Center
  2.  * Center Object by Bounding Box  */
  3. /* By Arnie Cachelin © 1992 NewTek Inc. */
  4.  
  5.  
  6. libadd = addlib("LWModelerARexx.port",0)
  7. signal on error
  8. signal on syntax
  9. box=boundingbox()  /* Should check out empty list ...  */
  10. parse var box n x1 x2 y1 y2 z1 z2
  11. say box
  12. cx=-(x2+x1)/2
  13. cy=-(y2+y1)/2
  14. cz=-(z2+z1)/2
  15.  
  16. /*  Uncomment this stuff to get center info and a chance to avoid the move
  17. s1='@'x1 y1 z1
  18. s2='@'x2 y2 z2
  19. s3='@'abs(cx) abs(cy) abs(cz)
  20. if notify(2,'@Bounding Box:',s1,s2,'@Center position:',s3,'!Center Object?') then
  21. */
  22.   call MOVE(cx cy cz)
  23. if (libadd) then call remlib("LWModelerARexx.port")
  24. exit
  25.  
  26. syntax:
  27. error:
  28.     t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  29.   if (libadd) then call remlib("LWModelerARexx.port")
  30.     exit
  31.